package main

import (
	"fmt"
	"sync"
	"time"
)

var wg1 sync.WaitGroup

func worker1(ch chan int)  {
LOOP:
	for {
		fmt.Println("worker")
		time.Sleep(time.Second)
		select {
		case <-ch :
			fmt.Println(11)
			break LOOP
		default:
		}
	}
	wg.Done()
}
func main() {
	var ch = make(chan int)
	wg1.Add(1)
	go worker1(ch)
	time.Sleep(time.Second * 3)
	ch <- 1
	close(ch)
	wg1.Wait()
	fmt.Println("over")
}
